package com.hejielife.activeobject1;

/**
 * 2019年8月2日 下午5:15:15
 * 
 * @author hejielife
 * @despribe Proxy
 */
class Proxy implements ActiveObject {
	private final SchedulerThread scheduler;
	private final Servant servant;

	public Proxy(SchedulerThread scheduler, Servant servant) {
		this.scheduler = scheduler;
		this.servant = servant;
	}

	public Result makeString(int count, char fillchar) {
		FutureResult future = new FutureResult();
		scheduler.invoke(new MakeStringRequest(servant, future, count, fillchar));
		return future;
	}

	public void displayString(String string) {
		scheduler.invoke(new DisplayStringRequest(servant, string));
	}
}
